package com.linksoul.mapper;

import com.linksoul.domain.TestDimensionDetail;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2025/05/01/17:13
 **/
@Mapper
public interface TestDimensionDetailMapper {
    @Insert("INSERT INTO soul_mbti.test_dimension_detail (request_id, ei_score, sn_score, tf_score, jp_score) " +
            "VALUES (#{requestId}, #{eiScore}, #{snScore}, #{tfScore}, #{jpScore})")
    int insert(TestDimensionDetail detail);
    @Select("SELECT * FROM test_dimension_detail WHERE request_id = #{requestId}")
    TestDimensionDetail selectByRequestId(String requestId);

    @Update("UPDATE test_dimension_detail SET " +
            "ei_score = #{eiScore}, sn_score = #{snScore}, tf_score = #{tfScore}, jp_score = #{jpScore} " +
            "WHERE request_id = #{requestId}")
    int updateByRequestId(TestDimensionDetail detail);
}
